<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<script type="text/javascript">
  $('#addWxUserTagBtn').linkbutton({
    iconCls : 'icon-add'
  });
  $('#delWxUserTagBtn').linkbutton({
    iconCls : 'icon-remove'
  });
  $('#addWxUserTagBtn').bind('click', function() {
    var tr = $("#add_wxUserTag_table_template tr").clone();
    $("#add_wxUserTag_table").append(tr);
    resetTrNum('add_wxUserTag_table');
    return false;
  });
  $('#delWxUserTagBtn').bind('click', function() {
    $("#add_wxUserTag_table").find("input:checked").parent().parent().remove();
    resetTrNum('add_wxUserTag_table');
    return false;
  });
  $(document).ready(function() {
    $(".datagrid-toolbar").parent().css("width", "auto");
    if (location.href.indexOf("load=detail") != -1) {
      $(":input").attr("disabled", "true");
      $(".datagrid-toolbar").hide();
    }
    //将表格的表头固定
    $("#wxUserTag_table").createhftable({
      height : '300px',
      width : 'auto',
      fixFooter : false
    });
  });
</script>
<div style="padding: 3px; height: 25px; width: auto;"
	class="datagrid-toolbar">
	<a id="addWxUserTagBtn" href="#">添加</a> <a id="delWxUserTagBtn"
		href="#">删除</a>
</div>
<table border="0" cellpadding="2" cellspacing="0" id="wxUserTag_table">
	<tr bgcolor="#E6E6E6">
		<td align="center" bgcolor="#EEEEEE" style="width: 25px;">序号</td>
		<td align="center" bgcolor="#EEEEEE" style="width: 25px;">操作</td>
		<td align="left" bgcolor="#EEEEEE" style="width: 126px;">用户头像</td>
		<td align="left" bgcolor="#EEEEEE" style="width: 126px;">用户名称</td>
	</tr>
	<tbody id="add_wxUserTag_table">
		<c:if test="${fn:length(wxUserTagList)  > 0 }">
			<c:forEach items="${wxUserTagList}" var="poVal" varStatus="stuts">
				<tr>
					<td align="center"><div style="width: 25px;" name="xh">${stuts.index+1 }</div></td>
					<td align="center"><input style="width: 20px;" type="checkbox"
						name="ck" /></td>
					<input name="wxUserTagList[${stuts.index }].id" type="hidden"
						value="${poVal.id }" />
					<input name="wxUserTagList[${stuts.index }].createName"
						type="hidden" value="${poVal.createName }" />
					<input name="wxUserTagList[${stuts.index }].createBy" type="hidden"
						value="${poVal.createBy }" />
					<input name="wxUserTagList[${stuts.index }].createDate"
						type="hidden" value="${poVal.createDate }" />
					<input name="wxUserTagList[${stuts.index }].userId" type="hidden"
						value="${poVal.userId }" />
					<input name="wxUserTagList[${stuts.index }].tagId" type="hidden"
						value="${poVal.tagId }" />
					<input name="wxUserTagList[${stuts.index }].userIcon" type="hidden"
						class="user-icon" value="${poVal.userIcon }" />
					
					<td align="left" style="width: 80px;"><img
						src="${poVal.userIcon}" maxlength="256" type="text"
						class="inputxt img-user-icon" style="width: 40px; height: 40px;">
						<label class="Validform_label" style="display: none;">用户头像</label>
					</td>
					
					<td align="left"><input
						name="wxUserTagList[${stuts.index }].userName" maxlength="100"
						class="user-name" type="text" class="inputxt"
						onclick="openUserSelectDlg(this)" style="width: 120px;"
						value="${poVal.userName }"> <label class="Validform_label"
						style="display: none;">用户名称</label></td>
				</tr>
			</c:forEach>
		</c:if>
	</tbody>
</table>
